package pa3;

import java.rmi.RemoteException;

import pa3.gui.HostController;

public class Main {
	public static void main(String args[]){
		try {
			Thread systemManager = new Thread(new SystemManagerImpl());
			systemManager.start();
			Thread.sleep(5000);
			
			Thread logger = new Thread(new LoggerImpl());
			logger.start();
			Thread.sleep(5000);
			
//			//create 4 hosts with zero failure rate
//			new Thread(new HostImpl("hostx1", 0)).start();
//			Thread.sleep(1000);
//			new Thread(new HostImpl("hostx2", 90)).start();
//			Thread.sleep(400);
//			//create 4 hosts with 50% failure rate
//			new Thread(new HostImpl("hostx5", 10)).start();
//			Thread.sleep(2000);
//			new Thread(new HostImpl("hostx6", 0)).start();
//			Thread.sleep(2500);
//			new Thread(new HostImpl("hostx7", 60)).start();
//			Thread.sleep(3000);
//			new Thread(new HostImpl("hostx8", 0)).start();
//			Thread.sleep(1000);
//			new Thread(new HostImpl("hostx3", 40)).start();
//			Thread.sleep(900);
//			new Thread(new HostImpl("hostx4", 0)).start();
			
			
//			HostState hostState1 = new HostState("host1", 0);
//			HostState hostState2 = new HostState("host2", 0);
//			HostState hostState3 = new HostState("host3", 0);
//			HostState hostState4 = new HostState("host4", 0);
//			HostState hostState5 = new HostState("host5", 0);
			
			//create 4 hosts with zero failure rate
//			new Thread(new HostImplNew(hostState1)).start();
//			Thread.sleep(1000);
//			new Thread(new HostImplNew(hostState2)).start();
//			Thread.sleep(400);
//			//create 4 hosts with 50% failure rate
//			new Thread(new HostImplNew(hostState3)).start();
//			Thread.sleep(2000);
//			new Thread(new HostImplNew(hostState4)).start();
//			Thread.sleep(2500);
//			new Thread(new HostImplNew(hostState5)).start();
//			Thread.sleep(3000);
			
			HostController c1 = new HostController("host1", 50);
			Thread.sleep(900);
			HostController c2 = new HostController("host2", 0);
			Thread.sleep(400);
			HostController c3 = new HostController("host3", 0);
			Thread.sleep(1200);
			HostController c4 = new HostController("host4", 0);
			Thread.sleep(200);

			
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
